package cn.dust.design.pattern.behavioral.memento;

import java.util.Stack;

/**
 * @Author: dust
 * @Date: 2019/11/28 16:48
 */
public class ArticleMementoManager {

    private final Stack<ArticleMemento> ARTICLE_MEMENTO_STACK=new Stack<ArticleMemento>();

    public ArticleMemento getMemento(){
        ArticleMemento articleMemento=ARTICLE_MEMENTO_STACK.pop();
        return articleMemento;
    }

    public void addMemento(ArticleMemento articleMemento){
        ARTICLE_MEMENTO_STACK.add(articleMemento);
    }

}
